home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_bosswatfog.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  119 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_BoulderFog.cog
  4. #
  5. # [MDR] && [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     pulse
  14.     
  15.     thing       player          local
  16.     thing       fogGhost
  17.     
  18.     sector      sec_On1
  19.     sector      sec_On2
  20.     
  21.     sector      sec_Blue1
  22.     sector      sec_Red1
  23.                        
  24.     vector      vec_facing      local
  25.     
  26.     int         ready=0         local
  27.     int         on=1            local
  28.     
  29. end
  30.  
  31. # ========================================================================================
  32.  
  33. code
  34.  
  35. entered:
  36.  
  37.     player = GetLocalPlayerThing();
  38.     
  39.     # going towards outside, but can still turn around
  40.     # to look at red lava
  41.     if(GetSenderRef() == sec_On1)
  42.     {
  43.         Print("sec_On1 on");
  44.         on = 1;
  45.         ready = 1;
  46.         SetPulse(0.5);
  47.         
  48.         # set fog to blue
  49.         SetFog(1, '0.5 0.5 0.6', 10, 350);
  50.     }
  51.     
  52.     # far enough outside that we can go totally blue
  53.     else if(GetSenderRef() == sec_Blue1)
  54.     {
  55.         Print("sec_Blue1 on");
  56.         SetPulse(0.0);
  57.         
  58.         # set fog to blue
  59.         SetFog(1, '0.5 0.5 0.6', 10, 350);
  60.     }
  61.     
  62.     # coming back, but can still turn around to
  63.     # look at blue outside
  64.     else if(GetSenderRef() == sec_On2)
  65.     {
  66.         Print("sec_On2 on");
  67.         ready = 1;
  68.         SetPulse(0.5);
  69.         
  70.         # set fog to red
  71.         SetFog(1, '0.5, 0.05 0.05', 50, 180);
  72.     }
  73.     
  74.     # far enough inside that we can go totally red
  75.     else if(GetSenderRef() == sec_Red1)
  76.     {
  77.         Print("sec_Red1 on");
  78.         SetPulse(0.0);
  79.         
  80.         # set fog to red
  81.         SetFog(1, '0.5, 0.05 0.05', 50, 180);
  82.     }
  83.         
  84.     return;
  85.         
  86. # ========================================================================================
  87.  
  88. pulse:
  89.  
  90.     vec_facing = VectorSub( GetThingPos(fogGhost), GetThingPos(player));
  91.     vec_facing = VectorNorm(vec_facing);
  92.     
  93.     if(ready == 1)
  94.     {
  95.         if (VectorDot(GetThingLVec(player), vec_facing) >= 0)
  96.         {
  97.             # Player is facing fogGhost
  98.             # set fog to red
  99.             SetFog(1, '0.5, 0.05 0.05', 50, 180);
  100.         }
  101.         
  102.         else
  103.         {
  104.             # player's back is to fogGhost
  105.             # set fog to blue
  106.             SetFog(1, '0.5 0.5 0.6', 10, 350);
  107.         }
  108.     }
  109.     
  110.     else
  111.         return;
  112.     
  113.     return;
  114.         
  115. # ========================================================================================
  116.  
  117. end
  118.  
  119.